package com.iteye.wujun8.encrypt.input;

import java.io.File;

/**
 * User: wujun
 * Date: 2014/10/9
 */
public class InputProcessor {
    public static String getFilePath(String[] args) {
        String filePath;
        try {
            filePath = args[0];
        } catch (Exception e) {
            filePath = System.getProperty("user.dir");
        }
        if (!new File(filePath).exists()) {
            filePath = System.getProperty("user.dir") + File.separator + filePath;
        }
        return filePath;
    }

    public static String getPassword() {
        char[] pw = System.console().readPassword("Please input password: ");
        return new String(pw);
    }
}
